home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / say < prev    next >
Text File  |  2001-04-06  |  3KB  |  80 lines

  1. SYNOPSIS
  2.         void say(string str)
  3.         void say(string str, object exclude)
  4.         void say(string str, object *excludes)
  5.  
  6.         void say(mixed *arr)
  7.         void say(mixed *arr, object exclude)
  8.         void say(mixed *arr, object *excludes)
  9.  
  10. DESCRIPTION
  11.         There are two major modes of calling:
  12.         
  13.         If the first argument is a string <str>, it will be send to
  14.         all livings in the current room        except to the initiator.
  15.  
  16.         If the first argument is an array <arr>, the lfun catch_msg()
  17.         of all living objects except the initiator will be called.
  18.         This array will be given as first argument to the lfun, and
  19.         the initiating object as the second.
  20.         CAVEAT: If the lfun catch_msg() modifies the <arr>, all subsequent
  21.         objects will receive the modified <arr>.
  22.  
  23.         By specifying a second argument to the efun one can exclude
  24.         more objects than just the initiator. If the second argument
  25.         is a single object <exclude>, both the given object and the
  26.         initiator are excluded from the call. If the second argument
  27.         is an array <excludes>, all objects and just the objects in
  28.         this array are excluded from the call.
  29.  
  30.         The 'initiator' is determined according to these rules:
  31.           - if the say() is called from within a living object, this
  32.             becomes the initiator
  33.           - if the say() is called from within a dead object as result
  34.             of a user action (i.e. this_player() is valid), this_player()
  35.             becomes the initiator.
  36.           - Else the object calling the say() becomes the initiator.
  37.  
  38. EXAMPLES
  39.         say("Hi!\n");
  40.         say("Hi!\n", this_player());
  41.         Both calls are equal when called by a not living object.
  42.         
  43.         Object 1 (living):
  44.            void catch_tell(string str) {
  45.               write("Received: "+str+"\n");
  46.            }
  47.         Object 2 (not living):
  48.            void func() {
  49.               ...
  50.               say("HiHo!\n");
  51.               ...
  52.            }
  53.         
  54.         This examples shows how say() together with catch_tell()
  55.         works. The 2nd object must not be living so the write() will
  56.         go to the current user.
  57.         
  58.         
  59.         Object 1 (living):
  60.            void catch_msg(mixed *arr, object who) {
  61.               int i;
  62.               if(!arr) return;
  63.               for(i=0;i<sizeof(arr);i++)
  64.                  tell_object(who, (stringp(arr[i]) ? arr[i] : "-/-")+"\n");
  65.            }
  66.         Object 2 (not living):
  67.            void func() {
  68.               ...
  69.               say( ({ "Hello", "there!" }) );
  70.               ...
  71.            }
  72.         
  73.         This is a bit complex example to demonstrate how say() and
  74.         catch_msg() works. Here we also use a non living object to
  75.         send the message so the who in catch_msg() will be the current
  76.         user.
  77.  
  78. SEE ALSO
  79.         write(E), tell_object(E), tell_room(E)
  80.